package server.jsons;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonFactory {
	
	private static GsonBuilder myGsonBuilder = null;
	
	private static void initGsonFactory(){
		myGsonBuilder = new GsonBuilder();
		//myGsonBuilder.registerTypeAdapter(User.class , new MessageAdapter());
		//myGsonBuilder.registerTypeAdapter(User.class, new UserAdapter());
		//myGsonBuilder.setPrettyPrinting();
		myGsonBuilder.excludeFieldsWithoutExposeAnnotation();
	}
	
	public static Gson getGson(){
		if(myGsonBuilder == null){
			myGsonBuilder = new GsonBuilder();
			GsonFactory.initGsonFactory();
		}
		return myGsonBuilder.create();
	}

}
